<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet"> 
<link href="./css/style.css" rel="stylesheet" type="text/css">
</head>
	<%
		String firstname = (String) request.getAttribute("firstname");
		String lastname = (String) request.getAttribute("lastname");
		String courseNumber = (String) request.getAttribute("courseNumber");
		String sectionNumber = (String) request.getAttribute("sectionNumber");
	%>
<script>
function validateFiles()
{
	var GroupFile = document.getElementsByName('grouplist');
	
	var gValue = GroupFile.value;

	
	if(gValue == null || sValue == "")
	{
		sValue = "blank";
	}
	
	return true;
}
</script>
<body>

<div id="container">
	<div id="header"><br>
		<h1 id="main-title"><b><font color = "000000">EECE Student Group Assessments</b></font></h1>
	</div>
    <div id="body" align="left">
    		   <form id=form method="post" action="ProfBackCoursePortalServlet">
             	<a href = "javascript:;" onclick="document.getElementById('form').submit();" class="back-button big page-back">
             		<input type = "hidden" name = "firstname" value = <%=firstname%>>
					<input type = "hidden" name = "lastname" value = <%=lastname%>>	
					<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
					<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
             	</a>
            </form>
    <div id="innerBody" class="page-region-content tiles" align="center">
		<h2><font size ="18">Student Group Formation for <%=courseNumber%> Section <%=sectionNumber%></font></h2><br>
		<p><font size = "4"></font></p><br>
		<form name = "random" id="random" action = "ProfRandomGroupAssignmentServlet" method = "post">
			<p>Make sure classrooms have been added before proceeding and 
			please specify the minimum and maximum number (must only be 1 value apart) of students in each group for Random Assignment:</p><br>
			
			<p>Min:</p>
			<p>
			  <input type="text" name="Min">
			</p>
			<p>Max:</p>
			<p>
			  <input type="text" name="Max">
			</p>
	
			<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
			<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
			<input type = "hidden" name = "firstname" value = <%=firstname%>>
			<input type = "hidden" name = "lastname" value = <%=lastname%>>		
			<input type="submit" value="Random Assignment"/><br>
		</form>
			<h2>OR</h2><br>
		<form name = "addList" id="addList" action = "ProfUploadGroupServlet" method = "post"  enctype="multipart/form-data">
			Upload Group List (in csv format):<input type="file" name="grouplist"> 
			<br><br>
			<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
			<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>
			<input type = "hidden" name = "firstname" value = <%=firstname%>>
			<input type = "hidden" name = "lastname" value = <%=lastname%>>		
			<input type="submit" value="Add Groups" onclick = "return validateFiles()"/>
		</form>
		</div>
	</div>
			<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
</div>
</body>
</html>